/*
 * Copyright (c) xxxx my copyright message. 2022-2023. All rights reserved.
 *
 */

package com.freeworker.aiusage.exception;

import lombok.*;


/**
 * 异常类
 *
 * @author lenovo
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class CommonException extends RuntimeException {

    private static final long serialVersionUID = 1412776805573049160L;

    private int code;

    private String errMsg;

    public CommonException(CommonErrorCode errorCode){
        this.code = errorCode.getCode();
        this.errMsg = errorCode.getErrMsg();
    }
    public CommonException(String message){
        this.code = CommonErrorCode.MESSAGE_ERROR.getCode();
        this.errMsg = message;
    }
}
